/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.thienloc.omap.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "SHOOTING_CAMPAIGN", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ShootingCampaign.findAll", query = "SELECT s FROM ShootingCampaign s"),
    @NamedQuery(name = "ShootingCampaign.findByCampaignId", query = "SELECT s FROM ShootingCampaign s WHERE s.campaignId = :campaignId"),
    @NamedQuery(name = "ShootingCampaign.findByCreatedDate", query = "SELECT s FROM ShootingCampaign s WHERE s.createdDate = :createdDate"),
    @NamedQuery(name = "ShootingCampaign.findByCreatedBy", query = "SELECT s FROM ShootingCampaign s WHERE s.createdBy = :createdBy"),
    @NamedQuery(name = "ShootingCampaign.findByShootingSpeed", query = "SELECT s FROM ShootingCampaign s WHERE s.shootingSpeed = :shootingSpeed"),
    @NamedQuery(name = "ShootingCampaign.findByTotalShot", query = "SELECT s FROM ShootingCampaign s WHERE s.totalShot = :totalShot"),
    @NamedQuery(name = "ShootingCampaign.findBySuccessShot", query = "SELECT s FROM ShootingCampaign s WHERE s.successShot = :successShot"),
    @NamedQuery(name = "ShootingCampaign.findByFailedShot", query = "SELECT s FROM ShootingCampaign s WHERE s.failedShot = :failedShot"),
    @NamedQuery(name = "ShootingCampaign.findByEndDate", query = "SELECT s FROM ShootingCampaign s WHERE s.endDate = :endDate"),
    @NamedQuery(name = "ShootingCampaign.findByTotalDuration", query = "SELECT s FROM ShootingCampaign s WHERE s.totalDuration = :totalDuration"),
    @NamedQuery(name = "ShootingCampaign.findByLastUpdatedBy", query = "SELECT s FROM ShootingCampaign s WHERE s.lastUpdatedBy = :lastUpdatedBy"),
    @NamedQuery(name = "ShootingCampaign.findByLastUpdatedDate", query = "SELECT s FROM ShootingCampaign s WHERE s.lastUpdatedDate = :lastUpdatedDate"),
    @NamedQuery(name = "ShootingCampaign.findByDescription", query = "SELECT s FROM ShootingCampaign s WHERE s.description = :description")})
public class ShootingCampaign implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "CAMPAIGN_ID")
    private Integer campaignId;
    @Column(name = "CREATED_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdDate;
    @Size(max = 200)
    @Column(name = "CREATED_BY")
    private String createdBy;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "SHOOTING_SPEED")
    private BigDecimal shootingSpeed;
    @Column(name = "TOTAL_SHOT")
    private Integer totalShot;
    @Column(name = "SUCCESS_SHOT")
    private Integer successShot;
    @Column(name = "FAILED_SHOT")
    private Integer failedShot;
    @Column(name = "END_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date endDate;
    @Column(name = "TOTAL_DURATION")
    private Integer totalDuration;
    @Size(max = 200)
    @Column(name = "LAST_UPDATED_BY")
    private String lastUpdatedBy;
    @Column(name = "LAST_UPDATED_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastUpdatedDate;
    @Size(max = 2000)
    @Column(name = "DESCRIPTION")
    private String description;
    @Size(max = 200)
    @Column(name = "CAMPAIGN_STATUS")
    private String campaignStatus;
    @OneToMany(mappedBy = "campaignId")
    private List<ShootingDetail> shootingDetailList;

    public ShootingCampaign() {
    }

    public ShootingCampaign(Integer campaignId) {
        this.campaignId = campaignId;
    }

    public Integer getCampaignId() {
        return campaignId;
    }

    public void setCampaignId(Integer campaignId) {
        this.campaignId = campaignId;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public BigDecimal getShootingSpeed() {
        return shootingSpeed;
    }

    public void setShootingSpeed(BigDecimal shootingSpeed) {
        this.shootingSpeed = shootingSpeed;
    }

    public Integer getTotalShot() {
        return totalShot;
    }

    public void setTotalShot(Integer totalShot) {
        this.totalShot = totalShot;
    }

    public Integer getSuccessShot() {
        return successShot;
    }

    public void setSuccessShot(Integer successShot) {
        this.successShot = successShot;
    }

    public Integer getFailedShot() {
        return failedShot;
    }

    public void setFailedShot(Integer failedShot) {
        this.failedShot = failedShot;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Integer getTotalDuration() {
        return totalDuration;
    }

    public void setTotalDuration(Integer totalDuration) {
        this.totalDuration = totalDuration;
    }

    public String getLastUpdatedBy() {
        return lastUpdatedBy;
    }

    public void setLastUpdatedBy(String lastUpdatedBy) {
        this.lastUpdatedBy = lastUpdatedBy;
    }

    public Date getLastUpdatedDate() {
        return lastUpdatedDate;
    }

    public void setLastUpdatedDate(Date lastUpdatedDate) {
        this.lastUpdatedDate = lastUpdatedDate;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @XmlTransient
    public List<ShootingDetail> getShootingDetailList() {
        return shootingDetailList;
    }

    public void setShootingDetailList(List<ShootingDetail> shootingDetailList) {
        this.shootingDetailList = shootingDetailList;
    }

    public String getCampaignStatus() {
        return campaignStatus;
    }

    public void setCampaignStatus(String campaignStatus) {
        this.campaignStatus = campaignStatus;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (campaignId != null ? campaignId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ShootingCampaign)) {
            return false;
        }
        ShootingCampaign other = (ShootingCampaign) object;
        if ((this.campaignId == null && other.campaignId != null) || (this.campaignId != null && !this.campaignId.equals(other.campaignId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.ShootingCampaign[ campaignId=" + campaignId + " ]";
    }
    
}
